package proyectobdii;

import java.util.LinkedList;
import javax.swing.table.DefaultTableModel;

public class GUI_Diff extends javax.swing.JFrame {
    
    private static Diff_Procedure diff_procedure;
    private static Diff_Tables diff_tables;
    private static Controller_Connection ctrl_conection;
   
    public GUI_Diff(Diff_Procedure diff_procedure, Diff_Tables diff_tables, Controller_Connection ctrl_conection) {
        this.ctrl_conection = ctrl_conection;
        this.diff_procedure = diff_procedure;
        this.diff_tables = diff_tables;
        initComponents();
        completarInfo();
    }

   
    @SuppressWarnings("unchecked")
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tablaComunes = new javax.swing.JTable();
        jLabel1 = new javax.swing.JLabel();
        nombreDataBaseI = new javax.swing.JLabel();
        nombreDataBaseII = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        exclusiveTablesDBI = new javax.swing.JTable();
        jScrollPane3 = new javax.swing.JScrollPane();
        exclusiveTablesDBII = new javax.swing.JTable();
        jScrollPane4 = new javax.swing.JScrollPane();
        diffTablas = new javax.swing.JTextPane();
        jLabel6 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        nombreDataBaseiI = new javax.swing.JLabel();
        nombreDataBaseiII = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jScrollPane5 = new javax.swing.JScrollPane();
        tablaProcedExclusivosBD2 = new javax.swing.JTable();
        jScrollPane6 = new javax.swing.JScrollPane();
        tablaProcedExclusivosBD1 = new javax.swing.JTable();
        jLabel11 = new javax.swing.JLabel();
        jScrollPane7 = new javax.swing.JScrollPane();
        tablaProcedComunes = new javax.swing.JTable();
        jLabel12 = new javax.swing.JLabel();
        jScrollPane8 = new javax.swing.JScrollPane();
        diffProced = new javax.swing.JTextPane();
        jButton2 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        tablaComunes.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Nombre", "PK", "Columnas"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(tablaComunes);

        jLabel1.setFont(new java.awt.Font("Ubuntu", 1, 15));
        jLabel1.setText("Tablas en común");

        nombreDataBaseI.setFont(new java.awt.Font("Ubuntu", 1, 18));
        nombreDataBaseI.setText("Base de Datos 1:    " + diff_tables.getNombreDataBase(1));

        nombreDataBaseII.setFont(new java.awt.Font("Ubuntu", 1, 18));
        nombreDataBaseII.setText("Base de Datos 2:    " + diff_tables.getNombreDataBase(2));

        jLabel4.setFont(new java.awt.Font("Ubuntu", 1, 15));
        jLabel4.setText("Tablas Exclusivas BD1");

        jLabel5.setFont(new java.awt.Font("Ubuntu", 1, 15));
        jLabel5.setText("Tablas Exclusivas BD 2");

        exclusiveTablesDBI.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Nombre", "Pk", "Columnas"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane2.setViewportView(exclusiveTablesDBI);
        exclusiveTablesDBI.getColumnModel().getColumn(0).setResizable(false);

        exclusiveTablesDBII.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Nombre", "PK", "Columnas"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane3.setViewportView(exclusiveTablesDBII);

        diffTablas.setEditable(false);
        jScrollPane4.setViewportView(diffTablas);

        jLabel6.setFont(new java.awt.Font("Ubuntu", 1, 15));
        jLabel6.setText("Diferencias de Tablas Con Mismo Nombre");

        jButton1.setText("Volver");
        jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton1MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(28, 28, 28)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 676, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(nombreDataBaseI)
                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 332, Short.MAX_VALUE))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(nombreDataBaseII)
                                        .addGap(217, 217, 217))
                                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)))
                            .addComponent(jButton1)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(294, 294, 294)
                        .addComponent(jLabel1))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(130, 130, 130)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 452, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(215, 215, 215)
                        .addComponent(jLabel6)))
                .addContainerGap(24, Short.MAX_VALUE))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(109, 109, 109)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 194, Short.MAX_VALUE)
                .addComponent(jLabel5)
                .addGap(128, 128, 128))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(nombreDataBaseI)
                    .addComponent(nombreDataBaseII))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(12, 12, 12)
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(3, 3, 3)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton1)
                .addGap(12, 12, 12))
        );

        jTabbedPane1.addTab("Tablas", jPanel1);

        nombreDataBaseiI.setFont(new java.awt.Font("Ubuntu", 1, 18));
        nombreDataBaseiI.setText("BD 1:   "+diff_procedure.getNombreDataBase(1));

        nombreDataBaseiII.setFont(new java.awt.Font("Ubuntu", 1, 18));
        nombreDataBaseiII.setText("BD 2:   "+diff_procedure.getNombreDataBase(2));

        jLabel9.setFont(new java.awt.Font("Ubuntu", 1, 15));
        jLabel9.setText("Procedimientos Exclusivos BD1");

        jLabel10.setFont(new java.awt.Font("Ubuntu", 1, 15));
        jLabel10.setText("Procedimientos Exclusivos BD 2");

        tablaProcedExclusivosBD2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Nombre", "Tipo devuelto", "Parametros"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane5.setViewportView(tablaProcedExclusivosBD2);

        tablaProcedExclusivosBD1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Nombre", "Tipo devuelto", "Parametros"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane6.setViewportView(tablaProcedExclusivosBD1);

        jLabel11.setFont(new java.awt.Font("Ubuntu", 1, 15));
        jLabel11.setText("Procedimientos en común");

        tablaProcedComunes.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Nombre", "Tipo devuelto", "Parametros"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane7.setViewportView(tablaProcedComunes);

        jLabel12.setFont(new java.awt.Font("Ubuntu", 1, 15));
        jLabel12.setText("Diferencias de Procedimientos Con Mismo Nombre");

        diffProced.setEditable(false);
        jScrollPane8.setViewportView(diffProced);

        jButton2.setText("Volver");
        jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton2MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(28, 28, 28)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jScrollPane8, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 676, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(nombreDataBaseiI)
                                    .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 332, Short.MAX_VALUE))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(nombreDataBaseiII)
                                    .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 345, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jButton2)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(130, 130, 130)
                        .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 452, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(22, Short.MAX_VALUE))
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(78, 78, 78)
                .addComponent(jLabel9)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 124, Short.MAX_VALUE)
                .addComponent(jLabel10)
                .addGap(91, 91, 91))
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(268, 268, 268)
                .addComponent(jLabel11)
                .addContainerGap(292, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(188, Short.MAX_VALUE)
                .addComponent(jLabel12)
                .addGap(197, 197, 197))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(nombreDataBaseiI)
                    .addComponent(nombreDataBaseiII))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(jLabel10))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(12, 12, 12)
                .addComponent(jLabel11)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(3, 3, 3)
                .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(6, 6, 6)
                .addComponent(jButton2)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Procedimientos", jPanel2);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 753, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1)
        );

        pack();
    }

    private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {                                      
        GUI_Options gui=new GUI_Options(ctrl_conection);
        gui.setHostBDI(ctrl_conection.getDataBaseI().getHost());
        gui.setHostBDII(ctrl_conection.getDataBaseII().getHost());
        gui.setNameBDI(ctrl_conection.getDataBaseI().getDataBaseName());
        gui.setNameBDII(ctrl_conection.getDataBaseII().getDataBaseName());
        gui.setVisible(true);
        dispose();
    }

    private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {                                      
        GUI_Options gui=new GUI_Options(ctrl_conection);
        gui.setHostBDI(ctrl_conection.getDataBaseI().getHost());
        gui.setHostBDII(ctrl_conection.getDataBaseII().getHost());
        gui.setNameBDI(ctrl_conection.getDataBaseI().getDataBaseName());
        gui.setNameBDII(ctrl_conection.getDataBaseII().getDataBaseName());
        gui.setVisible(true);
        dispose();
    }


    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                System.out.println("diff procedures main: "+diff_procedure);
                new GUI_Diff(diff_procedure, diff_tables,ctrl_conection).setVisible(true);
            }
        });
    }

    private javax.swing.JTextPane diffProced;
    private javax.swing.JTextPane diffTablas;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JLabel nombreDataBaseI;
    private javax.swing.JLabel nombreDataBaseiI;
    private javax.swing.JLabel nombreDataBaseII;
    private javax.swing.JLabel nombreDataBaseiII;
    private javax.swing.JTable tablaComunes;
    private javax.swing.JTable exclusiveTablesDBI;
    private javax.swing.JTable exclusiveTablesDBII;
    private javax.swing.JTable tablaProcedComunes;
    private javax.swing.JTable tablaProcedExclusivosBD1;
    private javax.swing.JTable tablaProcedExclusivosBD2;

    private void completarInfo(){
    	//COMPLETAMOS LAS TABLAS COMUNES    
    	LinkedList<Table> commonTables = diff_tables.getCommonTables();
    	for(int i=0;i<commonTables.size();i++){
    		Table tabla = commonTables.get(i);
    		tablaComunes.setValueAt(tabla.getNombre(), i, 0);
    		tablaComunes.setValueAt(tabla.getPk(), i, 1);
    		tablaComunes.setValueAt(tabla.getColumnas().toString(), i, 2);
    	}

    	//COMPLETAMOS LAS TABLAS EXCLUSIVAS BD 1
    	LinkedList<Table> exclusiveTables = diff_tables.getExclusiveTablesDBI();

    	for(int i=0;i<exclusiveTables.size();i++){
    		Table tabla = exclusiveTables.get(i);
    		exclusiveTablesDBI.setValueAt(tabla.getNombre(), i, 0);
    		exclusiveTablesDBI.setValueAt(tabla.getPk(), i, 1);
    		exclusiveTablesDBI.setValueAt(tabla.getColumnas().toString(), i, 2);
    	}

    	//COMPLETAMOS LAS TABLAS EXCLUSIVAS BD 2
    	exclusiveTables = diff_tables.getExclusiveTablesDBII();

    	for(int i=0;i<exclusiveTables.size();i++){
    		Table tabla = exclusiveTables.get(i);
    		exclusiveTablesDBII.setValueAt(tabla.getNombre(), i, 0);
    		exclusiveTablesDBII.setValueAt(tabla.getPk(), i, 1);
    		exclusiveTablesDBII.setValueAt(tabla.getColumnas().toString(), i, 2);
    	}


    	LinkedList<Procedure> exclusiveProcedure = diff_procedure.getExclusiveProcedureDBI();
        System.out.println("exclusive procedure: "+exclusiveProcedure.size());
    	for(int i=0;i<exclusiveProcedure.size();i++){
    		Procedure procedure = exclusiveProcedure.get(i);
    		tablaProcedExclusivosBD1.setValueAt(procedure.getNombre(), i, 0);
    		tablaProcedExclusivosBD1.setValueAt(procedure.getTipo(), i, 1);
    		tablaProcedExclusivosBD1.setValueAt(procedure.getParametros().toString(), i, 2);
    	}


    	exclusiveProcedure = diff_procedure.getExclusiveProcedureDBII();
        System.out.println("exclusive procedure II: "+exclusiveProcedure.size());
    	for(int i=0;i<exclusiveProcedure.size();i++){
    		Procedure procedure = exclusiveProcedure.get(i);
    		tablaProcedExclusivosBD2.setValueAt(procedure.getNombre(), i, 0);
    		tablaProcedExclusivosBD2.setValueAt(procedure.getTipo(), i, 1);
    		tablaProcedExclusivosBD2.setValueAt(procedure.getParametros().toString(), i, 2);
    	}


    	LinkedList<Procedure> commonProcedure = diff_procedure.getCommonProcedure();

    	for(int i=0;i<commonProcedure.size();i++){
    		Procedure procedimiento = commonProcedure.get(i);
    		tablaProcedComunes.setValueAt(procedimiento.getNombre(), i, 0);
    		tablaProcedComunes.setValueAt(procedimiento.getTipo(), i, 1);
    		tablaProcedComunes.setValueAt(procedimiento.getParametros().toString(), i, 2);
    	}

    	commonTables = diff_tables.getDifferentTables();

    	String s = "";
    	for(int i=0;i<commonTables.size();i=i+2){
    		Table tabla = commonTables.get(i);
    		Table tabla2 = commonTables.get(i+1);
    		s+="NOMBRE: "+tabla.getNombre()+"\n";
    		s+="PK en BDI: '"+tabla.getPk()+"' PK en BDII: '"+tabla2.getPk()+"'";
    		s+="\n";
    		s+="UNIQUE en BDI: '"+tabla.getUniques().toString()+"' UNIQUE en BDII: '"+tabla2.getUniques().toString()+"'";
    		s+="\n";
    		s+="COLUMNAS en BDI: "+tabla.getColumnas().toString();
    		s+="\n";
    		s+="COLUMNAS en BDII: "+tabla2.getColumnas().toString();
    		s+="\n";
    		s+="TRIGGERS en BDI: "+tabla.getTriggers().toString();
    		s+="\n";
    		s+="TRIGGERS en BDII: "+tabla2.getTriggers().toString();
    		s+="\n";
    		s+="\n";
    	}
    	diffTablas.setText(s);

    	commonProcedure = diff_procedure.getDifferentProcedure();
    	s = "";
    	for(int i=0;i<commonProcedure.size()/2;i++){
    		Procedure procedimiento = commonProcedure.get(i);
    		Procedure procedimiento2 = commonProcedure.get(i+1);
    		s+="NOMBRE: "+procedimiento.getNombre()+"\n";
    		s+="TIPO QUE DEVUELVE en BDI: '"+procedimiento.getTipo()+"' TIPO QUE DEVUELVE en BDII: '"+procedimiento2.getTipo()+"'";
    		s+="\n";
    		s+="PARAMETROS en BDI: "+procedimiento.getParametros().toString();
    		s+="\n";
    		s+="PARAMETROS en BDII: "+procedimiento2.getParametros().toString();
    		s+="\n";
    		s+="\n";
    	}
    	diffProced.setText(s);
    }

}
